package com.yida.gwj.expend.domain.message;

import java.util.List;

import com.yida.common.core.exception.ServiceException;
import com.yida.gwj.expend.domain.GwjMaintenanceFundsBusinessAttachment;

import cn.hutool.core.collection.CollectionUtil;
import cn.hutool.core.util.StrUtil;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;

/**
 * 二次补件提交请求参数
 *
 * @author liangp
 * @date 2023/02/23
 */
@ApiModel(description = "二次补件提交请求参数")
public class PreAcceptSecondSubmitMessage {

    private static final long serialVersionUID = 1L;

    @ApiModelProperty(value = "业务ID")
    private Long bizId;

    @ApiModelProperty(value = "业务标识")
    private String serverIdentification;

    @ApiModelProperty(value = "外部业务标识")
    private String outServerIdentification;
    @ApiModelProperty(value = "上传文件列表")
    private List<GwjMaintenanceFundsBusinessAttachment> maintenanceFundsBusinessAttachmentList;

    @ApiModelProperty(value = "申请报告")
    private String getApplicationReport;

    @ApiModelProperty(value = "业主征求意见材料")
    private String ownerComments;

    @ApiModelProperty(value = "业主确认证明")
    private String ownerConfirmationCertificate;

    public String getServerIdentification() {
        return serverIdentification;
    }

    public void setServerIdentification(String serverIdentification) {
        this.serverIdentification = serverIdentification;
    }

    public Long getBizId() {
        return bizId;
    }

    public void setBizId(Long bizId) {
        this.bizId = bizId;
    }

    public String getGetApplicationReport() {
        return getApplicationReport;
    }

    public void setGetApplicationReport(String getApplicationReport) {
        this.getApplicationReport = getApplicationReport;
    }

    public String getOwnerComments() {
        return ownerComments;
    }

    public void setOwnerComments(String ownerComments) {
        this.ownerComments = ownerComments;
    }

    public String getOwnerConfirmationCertificate() {
        return ownerConfirmationCertificate;
    }

    public void setOwnerConfirmationCertificate(String ownerConfirmationCertificate) {
        this.ownerConfirmationCertificate = ownerConfirmationCertificate;
    }

    public String getOutServerIdentification() {
        return outServerIdentification;
    }

    public void setOutServerIdentification(String outServerIdentification) {
        this.outServerIdentification = outServerIdentification;
    }

    public List<GwjMaintenanceFundsBusinessAttachment> getMaintenanceFundsBusinessAttachmentList() {
        return maintenanceFundsBusinessAttachmentList;
    }

    public void setMaintenanceFundsBusinessAttachmentList(List<GwjMaintenanceFundsBusinessAttachment> maintenanceFundsBusinessAttachmentList) {
        this.maintenanceFundsBusinessAttachmentList = maintenanceFundsBusinessAttachmentList;
    }

    @Override
    public String toString() {
        final StringBuilder sb = new StringBuilder("PreAcceptSecondSubmitMessage{");
        sb.append("bizId=").append(bizId);
        sb.append(", serverIdentification='").append(serverIdentification).append('\'');
        sb.append(", outServerIdentification='").append(outServerIdentification).append('\'');
        sb.append(", maintenanceFundsBusinessAttachmentList=").append(maintenanceFundsBusinessAttachmentList);
        sb.append(", getApplicationReport='").append(getApplicationReport).append('\'');
        sb.append(", ownerComments='").append(ownerComments).append('\'');
        sb.append(", ownerConfirmationCertificate='").append(ownerConfirmationCertificate).append('\'');
        sb.append('}');
        return sb.toString();
    }

    public void checkNull() {
        if (StrUtil.isBlank(serverIdentification)) {
            throw new ServiceException("serverIdentification 未获取到对应业务标识");
        }
        if (StrUtil.isBlank(outServerIdentification)) {
            throw new ServiceException("outServerIdentification 未获取到对应外部业务标识");
        }
        if (CollectionUtil.isEmpty(maintenanceFundsBusinessAttachmentList)) {
            throw new ServiceException("maintenanceFundsBusinessAttachmentList 上传文件列表不能为空，请选择附件进行上传");
        }
    }
}
